home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / IR Man™ / 2BufRecordToBufCmd.h < prev    next >
Encoding:
Text File  |  1992-06-06  |  2.1 KB  |  68 lines  |  [TEXT/MPS ]

  1.  
  2. /**********************************/
  3. /* #defines                          */
  4. /**********************************/
  5.  
  6. // Used as a macro to simplify one line of code. Use an exclusive OR to switch from 0 to 1, 
  7. // or from 1 to 0.  This is the index for our two buffer handle array
  8.  
  9. #define NextBuffer(x)                (x ^= 1)
  10.  
  11. //The number of Milliseconds of sound which is recorded before playback 70 best
  12. #define kMilliSecondsOfSound        250
  13.  
  14. //The number of Milliseconds of sound which is recorded before playback
  15. #define kNetBufferSize                20000
  16.  
  17. //Size of the top of the 'snd ' header
  18. #define    kBaseHeaderSize                6
  19.  
  20. //Multiplier to determine the size of the Synths in the header
  21. #define    kSynthSize                    6
  22.  
  23. //Multiplier to determine the size of the Cmds in the header
  24. #define    kCmdSize                    8
  25.  
  26. // Number of buffers being used
  27. #define    kNumberOfBuffers            2
  28.  
  29. // When building the SndHeader I use this constant to declare Middle C base Frequency
  30. #define    kMiddleC                    0x3C
  31.  
  32. // the error dialog for messages
  33. #define kErrorDialogID                128
  34.  
  35. // OK Button ID for the Error Handling Dialog
  36. #define    kOKButton                    1
  37.  
  38. // this is the static text item used to display the OSErr
  39. #define kErrNumStatText                5
  40.  
  41. // this is the static text item used to display a message to the user
  42. #define kMsgStatText                2
  43.  
  44. // nil used to open the default sound input driver
  45. #define    kDefaultDriver                nil
  46.  
  47. // estimate the largest 'snd ' header that we could imagine
  48. #define kEstimatedHeaderSize        (sizeof (SndListResource) + sizeof (ExtSoundHeader))
  49.  
  50. /**********************************/
  51. /* prototypes for the functions      */
  52. /**********************************/
  53.  
  54. void            TestTheSystem        (void);
  55. void            GetSoundDeviceInfo    (void);
  56. void            SetUpSounds            (Handle *bufferHandle, short *headerSize);
  57. int                FindHeaderSize        (void);
  58. void            BuildRecordStruct    (Handle bufferHandle);
  59. void             ResetSoundHeader     (Handle bufferHandle);
  60. void            ExitWithMessage        (char *message, OSErr error);
  61. void            TimeToQuit            (void);
  62. pascal    void    MyRecComp            (SPBPtr inParamPtr);
  63. void             RealCompletion         (void);
  64. void            InitSoundStuff        (void);
  65. void            StartRecord            (void);
  66. long            SendSoundData        (void);
  67. void            SoundCleanUpAndQuit (void);
  68.